package com.sun.floatwindow.basefloat;

import android.content.Context;
import android.view.Gravity;
import android.view.ViewConfiguration;

import com.blankj.utilcode.util.ActivityUtils;
import com.sun.floatwindow.R;

/**
 * Create by sun on 2020/7/31 5:16 PM
 */
public class FullScreenView extends AbsFloatBase {

    public FullScreenView(Context context) {
        super(context);

        mViewMode = FULLSCREEN_NOT_TOUCHABLE;

        mGravity = Gravity.CENTER_HORIZONTAL | Gravity.TOP;

        inflate(R.layout.main_layout_float_full_screen);

//        mGravity = Gravity.CENTER_HORIZONTAL | Gravity.START;
//        mAddX = 20;
//        inflate(R.layout.main_layout_follow_touch_land);
    }

    public void setStyle(int i) {
        if (i == 0) {
            mGravity = Gravity.CENTER_HORIZONTAL | Gravity.TOP;
            inflate(R.layout.main_layout_follow_touch);
        } else {
            mGravity = Gravity.CENTER_VERTICAL | Gravity.START;
            inflate(R.layout.main_layout_follow_touch_land);
        }
    }

    private void jumpHome() {
//        Intent intent = new Intent();
//        intent.setAction(Intent.ACTION_MAIN);
//        intent.addCategory(Intent.CATEGORY_HOME);
//        mContext.startActivity(intent);
        ActivityUtils.startHomeActivity();
    }


    @Override
    protected void onAddWindowFailed(Exception e) {

    }
}
